import requests

def post_file(file_name:str,url = 'raspberrypi/polls/test_channel/'):
    files = {'file': (file_name, open(file_name, 'rb'), 'application/pdf', {'Expires': '0'})}
    r = requests.post(url, files=files)
    if r.status_code!=200:
        print('post failed:',r.status_code)
    
if __name__=='__main__':
    post_file('test.pdf','http://127.0.0.1:8000/polls/test_channel/')